package day033;

public class Day02 {
    public static void main(String[] args) {
        //类型间转换
        byte b1=5;
        byte b2=6;
        System.out.println(2+2);
        System.out.println("我"+"你");
        System.out.println('2');
        System.out.println(2+'2');
        System.out.println("2"+'2');




















        /*
        int a=5;//自动类型转换
        long b=a;//自动类型转换
        int c=(int)b;//强制类型转换

        long d=5;//自动类型转换
        double e=5;//自动类型转换
        System.out.println(e);//5.0
        long f=10000000000L;
        int g=(int)f;
        System.out.println(g);//1410065408,强制转换可能发生溢出
        double h=25.978;
        int i=(int)h;
        System.out.println(i);//强制转换可能丢失精度


         */































        /*
        //5)char:字符型，2字节
        char c1='男';
        char c2='7';
        char c3='@';
        char c4='A';
        char c5=8888;
        char c7='\'';
        char c6='\\';


        System.out.println(c5);
        System.out.println(c6);
        System.out.println(c7);
        System.out.println(c1);
        System.out.println(c2);
        System.out.println(c3);


         */


















        /*
        //4)boolean:布尔型，1字节
        boolean a=true;
        boolean b=false;
        boolean c=true;
        System.out.println(3>4);

         */















        /*
        double a=25.67;
        float b=25.678f;
        double c=3.0,d=2.9;
        System.out.println(c-d);

         */




























        /*
        //2)long:长整型，8个字节，-900万万亿多到900万万亿多
        long a=25L;//
        //long b=100000000;
        long c=100000000000L;
        long d=365L*24*60*60*1000;
        System.out.println(d);
        long e=1000000000*2*10L;
        System.out.println(e);
        //long f=1000000000*3*10L;
        //System.out.println(f);
        long g=1000000000L*3*10;
        System.out.println(g);

         */






























        /*
        //1)int:整数型，4字节，-21亿多到21亿多
        int a=250;
        //int b=10000000000;//
        //int c=25.68;//
        System.out.println(5/2);   //2
        System.out.println(2/5);   //0
        System.out.println(5/2.0);   //2.5
        int d=2147483647;
        d=d+1;

         */




    }

}
